package com.zjitc.pigstudy.mapper;

import com.zjitc.pigstudy.domain.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where account = #{username}")
    User UserByName(String username);

    @Insert("insert into user(account,password,create_at) values(#{account},#{password},#{create_at})")
    Boolean register(User user);

    @Select("select * from user where id = #{userId}")
    User selectById(Integer userId);

    @Select("select * from user")
    List<User> selectAll();


    boolean updateUser(User user);
}
